# geom_map()

# setwd("D:/Program/RCode/Map")
setwd("D:/Code/RCode/Map")

library(ggplot2)
library(rgdal)

china_map_shp <- readOGR("./China_Province/bou2_4p.shp", stringsAsFactors = FALSE)
city_position <- read.csv("./China_Province/city.csv", stringsAsFactors = FALSE)

china_map_desp <- china_map_shp@data  # Description information
china_map_geom <- fortify(china_map_shp)  # Geometrical mapping info

province_name <- unique(china_map_desp$NAME)
value <- runif(length(province_name), 10, 100)


china_map_desp$value <- value


ggplot(china_map_value, aes(map_id = id)) +
  geom_map(aes(fill = value), map = china_map) +
  expand_limits(x = china_map$long, y = china_map$lat)
